package com.fancy.playlist.client;

import com.fancy.common.dto.SongBasicInfo;
import com.fancy.common.dto.response.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "music-service", path = "/api/v1/songs")
public interface MusicServiceClient {

    /**
     * 获取歌曲基本信息
     */
    @GetMapping("/internal/{songId}")
    Result<SongBasicInfo> getSongBasicInfo(@PathVariable("songId") Long songId);

    /**
     * 批量获取歌曲基本信息
     */
    @PostMapping("/internal/batch")
    Result<List<SongBasicInfo>> getSongBasicInfoBatch(@RequestBody List<Long> songIds);
}
